/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __PHYSICS_CONFIG_H__
#define __PHYSICS_CONFIG_H__

#include "OgreVector3.h"
#include "OgreAxisAlignedBox.h"

namespace PQEngine
{
	enum BroadPhaseType
	{
		BPT_DBVT,//btDbvtBroadphase dynamic AABB bounding volume hierarchies/trees
		BPT_AXISSWEEP3_32,//bt32BitAxisSweep3
	};

	//we will use this class construct our physics config ui
	class PhysicsConfig
	{
	private:
		float _fixedTimeStep;
		int _maxSubstep;
		BroadPhaseType _broadPhaseType;
		Ogre::Vector3 _gravity;
		Ogre::AxisAlignedBox _bounds;//world bounds

	protected:
		PhysicsConfig();
	public:
		static PhysicsConfig& getSingleton();

		inline Ogre::AxisAlignedBox& getWorldBounds()
		{
			return _bounds;
		}

		inline void setWorldBounds(Ogre::AxisAlignedBox bounds)
		{
			_bounds=bounds;
		}

		inline Ogre::Vector3& getGravity()
		{
			return _gravity;
		}

		inline void setGravity(Ogre::Vector3 gravity)
		{
			_gravity=gravity;
		}

		inline BroadPhaseType& getBroadPhaseType()
		{
			return _broadPhaseType;
		}

		inline void setBroadPhaseType(BroadPhaseType type)
		{
			_broadPhaseType=type;
		}

		inline void setFixedTimeStep(float step)
		{
			_fixedTimeStep=step;
		}

		inline float getFixedTimeStep()
		{
			return _fixedTimeStep;
		}

		inline void setMaxSubStep(int step)
		{
			_maxSubstep=step;
		}

		inline int getMaxSubStep()
		{
			return _maxSubstep;
		}
	};
}

#endif
